//==============================================================================
//
//               Copyright (C) 2002  Dick van Oudheusden
//  
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2003-10-31 08:12:33 $ $Revision: 1.1 $
//
//==============================================================================

#include <stdlib.h>

#include "ofc/config.h"

#include "ofc/DBitArray.h"

#include "DInc.h"
#include "DTest.h"

//-DataTypes-------------------------------------------------------------------

void DBitArray_test()
{
  DBitArray *rng = [DBitArray alloc];

  STARTTEST();

  TEST([rng init :0 :100] != nil);

  [rng set :7];

  TEST([rng count] == 1);

  [rng set :5 :9];

  TEST([rng count] == 5);
  
  TEST([rng has :6]);
  TEST(![rng has :10]);

  [rng set :-10 :200];

  TEST([rng count] == 101);

  [rng reset :-5 :99];

  TEST([rng count] == 1);

  TEST([rng has :100]);
  TEST(![rng has :0]);

  TEST([[rng reset] count] == 0);

  [rng set :1 :7 :2];
  TEST([rng count] == 4);
  
  STOPTEST();
} 

